<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="/static/houtai/css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/static/houtai/js/jquery-3.0.0.min.js"></script>
    <script type="text/javascript" src="/static/houtai/commons/common.js"></script>
    <script language="javascript">
        $(function(){
            //导航切换
            $(".imglist li").click(function(){
                $(".imglist li.selected").removeClass("selected")
                $(this).addClass("selected");
            })
        })
    </script>
    <script type="text/javascript">
        $(document).ready(function(){
            $(".click").click(function(){
                $(".tip").fadeIn(200);
            });

            $(".tiptop a").click(function(){
                $(".tip").fadeOut(200);
            });

            $(".sure").click(function(){
                $(".tip").fadeOut(100);
            });

            $(".cancel").click(function(){
                $(".tip").fadeOut(100);
            });

        });
    </script>
</head>
<body>
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">首页</a></li>
        <li><a href="#">中奖记录</a></li>
    </ul>
</div>
<div class="rightinfo">
    <ul class="forminfo">
        <li>微信号查找中奖记录：
            <form action="/drawRecord/findByWeiXin" method="get">
            <input name="weixinNumber" type="text" class="dfinput" id="weixinNumber"/>&nbsp
            <input name="" id="btn" type="submit" class="btn" value="查找"/>
            </form>
        </li>
    </ul>
    <table class="imgtable">
        <thead>
        <tr>
            <th>中奖微信号</th>
            <th>中奖奖品</th>
            <th>审核状态</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${page.list}" var="prize0">
        <tr>
            <td>${prize0.user.weixinNumber} </td>
            <td>${prize0.prize.name}</td></td>
            <td>
            <c:if test="${prize0.cashPrizeState == '0'}">
            <a href="/drawRecord/updateState?id=${prize0.id}&cashPrizeState=1">未核销</a>
            </c:if>

            <c:if test="${prize0.cashPrizeState == '1'}">
                <a href="/drawRecord/updateState?id=${prize0.id}&cashPrizeState=0">已核销</a></td>
            </c:if>
        </tr>
        </c:forEach>
        </tbody>

    </table>

</div>
<div style="text-align:center">
    <ul class="pagination pagination-lg">
        <li> <%--上一页 hasPreviousPage布尔值是否有上一页，prePage上一页页面--%>
            <c:if test="${page.hasPreviousPage}">
                <a href="${ctx}/drawRecord/prizeRecord/?pageNum=${page.prePage}&pageSize=${page.pageSize}">«</a>
            </c:if></li>
        <%--navigatepageNums 集合所有页码  --%>
        <c:forEach items="${page.navigatepageNums}" var="nav">
            <c:if test="${nav == page.pageNum}">
                <li style="font-weight: bold;"><a href="javascript:;">${nav}</a></li>
            </c:if>
            <c:if test="${nav != page.pageNum}">
                <li><a href="${ctx}/drawRecord/prizeRecord/?pageNum=${nav}&pageSize=${page.pageSize}">${nav}</a></li>
            </c:if>
        </c:forEach>
        <%--hasNextPage 布尔值判断是否有下一页 nextPage下一页的页码--%>
        <c:if test="${page.hasNextPage}">
            <li><a href="${ctx}/drawRecord/prizeRecord/?pageNum=${page.nextPage}&pageSize=${page.pageSize}">»</a></li>
        </c:if>
    </ul>
</div>
</body>
<%@ include file="foot.jsp"%>
<script language="javascript">

    $(function() {
        $(".hexiao").click(function(){
            $(this).html("已核销");
        });

    });
    $(function(){
        //导航切换
        $(".imglist li").click(function(){
            $(".imglist li.selected").removeClass("selected")
            $(this).addClass("selected");
        })
    })
</script>
<script type="text/javascript">
    $(function(){
        $(".click").click(function(){
            $(".tip").fadeIn(200);
        });

        $(".tiptop a").click(function(){
            $(".tip").fadeOut(200);
        });

        $(".sure").click(function(){
            $(".tip").fadeOut(100);
        });

        $(".cancel").click(function(){
            $(".tip").fadeOut(100);
        });
    });
</script>

